package com.umakr.ax.core;

import org.springframework.boot.Banner;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.event.ApplicationReadyEvent;

/**
 * @author gx
 * @since 2017/4/25
 */
public class Bootstrap {
    private Bootstrap() {
        throw new IllegalStateException("Bootstrap class");
    }
    public static <T> void run(Class<T> clazz,String[] args){
        new SpringApplicationBuilder()
                .bannerMode(Banner.Mode.OFF)
                .sources(clazz)
//                .child(clazz)
                .listeners((ApplicationReadyEvent applicationEvent)->AppInitializer.init(applicationEvent.getApplicationContext()))
                .run(args);
    }
}
